package cn.wen.javax.security;

import java.util.Date;
import java.util.Properties;

import cn.wen.java.text.Formatter;
import cn.wen.javax.security.IUser;

/**
 * Title：用户抽象实体
 * <p>
 * Description：
 * <p>
 * Copyright：Copyright (c) 2010-2012
 * 
 * @author <a href="mailto:ct_wen@qq.com">ctwen</a>, 温承瑭
 * @version Revision：1.0 Date：2012/3/21 Description：初完成。
 *          <p>
 */
public abstract class AbstractUser implements IUser {

    protected String loginId;

    protected String password;

    protected String name;

    protected boolean active = true;

    protected boolean lock;

    protected boolean admin;

    protected String gender;

    protected String email;

    protected Date regDate;

    protected Properties props = new Properties();

    @Override
    public String getLoginId() {
	return loginId;
    }

    @Override
    public void setLoginId(String loginId) {
	this.loginId = loginId;
    }

    @Override
    public String getPassword() {
	return password;
    }

    @Override
    public void setPassword(String password) {
	this.password = password;
    }

    @Override
    public String getName() {
	return name;
    }

    @Override
    public void setName(String name) {
	this.name = name;
    }

    @Override
    public boolean isActive() {
	return active;
    }

    @Override
    public void setActive(boolean active) {
	this.active = active;
    }

    @Override
    public boolean isLock() {
	return lock;
    }

    @Override
    public void setLock(boolean lock) {
	this.lock = lock;
    }

    @Override
    public boolean isAdmin() {
	return admin;
    }

    @Override
    public void setAdmin(boolean admin) {
	this.admin = admin;
    }

    @Override
    public String getGender() {
	return gender;
    }

    @Override
    public void setGender(String gender) {
	this.gender = gender;
    }

    @Override
    public String getEmail() {
	return email;
    }

    @Override
    public void setEmail(String email) {
	this.email = email;
    }

    @Override
    public Date getRegDate() {
	return regDate;
    }

    @Override
    public void setRegDate(Date regDate) {
	this.regDate = regDate;
    }

    @Override
    public String getRegDateString() {
	return getRegDateString("yyyy年MM月dd日 hh时mm分ss秒");
    }

    @Override
    public String getRegDateString(String pattern) {
	return Formatter.date(regDate, pattern);
    }

    @Override
    public Properties getProperties() {
	return props;
    }

    @Override
    public void setProperties(Properties properties) {
	this.props = properties;
    }

}
